UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qjfxYUABwKShCv2e0eIumYzc0ZNYz6yPq/bJKO1S7aw='
WHERE
key_id = '15c5ade974fc116e88684fd06bf7d48d9b62db1b618ebe07a0c84b39173eb275'
AND (
token = 'qjfxYUABwKShCv2e0eIumYzc0ZNYz6yPq/bJKO1S7aw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)