UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h0DVp0GTWFGVRwnBKjyfvMTWd8VRQolPL49u0/B04iY='
WHERE
key_id = 'e6966d953840005f32e387184fac604b3f3a5a28ffc98ccc9cc77cf4e9ef301b'
AND (
token = 'h0DVp0GTWFGVRwnBKjyfvMTWd8VRQolPL49u0/B04iY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)