Lottery ticket worth $617,000 sold in Hayward