UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rMtUhEhg6zBvD4poKis9W/KkMOlRsbzffA97luIgCAw='
WHERE
key_id = 'b0e36a11f44c09b647c384388912cdf54d89727cf4037d752e842237b0804852'
AND (
token = 'rMtUhEhg6zBvD4poKis9W/KkMOlRsbzffA97luIgCAw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)