UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x575Jke8jS74ve1duarr4pa2u5Ylcvw9OUi7djInIMA='
WHERE
key_id = '0942de76e264f0cf737fd55aa3975e223592f5cce8cb11aa5e197eba6b4695d4'
AND (
token = 'x575Jke8jS74ve1duarr4pa2u5Ylcvw9OUi7djInIMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)