UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mOxWLJkQn4BomuXkWTm1PJYpYu9FCfMwIvrsuNZNRYw='
WHERE
key_id = '094c2bc1067f4a68ebb9beda8246c2b71d1337d98ea62c1fa1c819b989e2beb7'
AND (
token = 'mOxWLJkQn4BomuXkWTm1PJYpYu9FCfMwIvrsuNZNRYw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)