UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n/ZkPlv7sdyc3uRTZWU63UwqBZwE69nKktVeltW8QGE='
WHERE
key_id = '407121388c950d3725ad8592306fda2ea4d0f3bb316ab0e5ec3ebd7656ee5ba2'
AND (
token = 'n/ZkPlv7sdyc3uRTZWU63UwqBZwE69nKktVeltW8QGE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)