UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TRFGUXUG8KLGEqUzlPLEV0QEECt0TvX4jTxTBxa2+Fg='
WHERE
key_id = '2a374b4ad6d7f1d64a1ec422a013e9f8484d678706bdd43930d528ac0adb7948'
AND (
token = 'TRFGUXUG8KLGEqUzlPLEV0QEECt0TvX4jTxTBxa2+Fg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)