UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fv5EHnjRoYHFzZ7e79XIPMugmsDvJHuKF4wt9/Fv/0c='
WHERE
key_id = '516f08b40c9479e3712a6406144c1e736d1102d56f5438c6013a1410ac7f3fb4'
AND (
token = 'fv5EHnjRoYHFzZ7e79XIPMugmsDvJHuKF4wt9/Fv/0c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)