UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gky+Ra8evZFg1zwV9hZvtB+3nJfjfuy6Fh5cJR6dQ5A='
WHERE
key_id = '2a7ab63ddf7faa1685786b89bf522d8105cdcde0aadd8871c320ecd5f3d0a4fd'
AND (
token = 'gky+Ra8evZFg1zwV9hZvtB+3nJfjfuy6Fh5cJR6dQ5A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)