UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HJu6NlLEd0Py43KJKHFU571Nj6qjkPdCSUFVfY6A8SE='
WHERE
key_id = '3503b21e6e7a60dae56fa74afca7125a4c8c1c7823a89eab83a27f1d2572df76'
AND (
token = 'HJu6NlLEd0Py43KJKHFU571Nj6qjkPdCSUFVfY6A8SE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)