UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GAm+U0CWmGfyW+paqWDJLKPfefEw5o9Gw5VzpNhR/YA='
WHERE
key_id = 'f4eef45751765285b9fb82d5f661bf324cec8b281e5e9d655f0b73f57e27e5bd'
AND (
token = 'GAm+U0CWmGfyW+paqWDJLKPfefEw5o9Gw5VzpNhR/YA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)