UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sESpudAzfacXgTW+5HXq7yw8CjSqM0Q1T5OQk13s78M='
WHERE
key_id = '76051790cd475d48a15cc8ecaaa7bdb31045cc453917897afc0462234c62fcf3'
AND (
token = 'sESpudAzfacXgTW+5HXq7yw8CjSqM0Q1T5OQk13s78M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)