UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q6NorIJE/6pz3AiC9AskSqVNsyMxDT8vneW18hF6aF8='
WHERE
key_id = '1a752babfd81c97ec5b6d35f96fec6f1625d34658b519fd0c58321b9e731285c'
AND (
token = 'Q6NorIJE/6pz3AiC9AskSqVNsyMxDT8vneW18hF6aF8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)