UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wYZmN8wPgXxFii0rTTODE1rClm4phU18DXJXVY/ZqeE='
WHERE
key_id = 'f054a72945a986ca53dc47acce261d009a43774ce8ce91815e1fd762723daccf'
AND (
token = 'wYZmN8wPgXxFii0rTTODE1rClm4phU18DXJXVY/ZqeE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)