UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mv9oQkkGpDxqswR+ShDdSbuRaOZ/pqefRo7uKXNYTz8='
WHERE
key_id = 'c913f6bdfa8b185e4accd995c9f1a1eff31940efcd811db9ee2786ed12ee8caa'
AND (
token = 'mv9oQkkGpDxqswR+ShDdSbuRaOZ/pqefRo7uKXNYTz8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)