update goods g set g.goods_status=0 where unix_timestamp(now()) > g.validity_end_time and g.goods_status = 1