UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nBYI6yTttuvrD9QFa84ubdAObNXVJzq5PM3uGc4QlMo='
WHERE
key_id = 'd88b899ab077ff199ee54d488b76e6b77a981d0cb207b62ecfc84893bcaab913'
AND (
token = 'nBYI6yTttuvrD9QFa84ubdAObNXVJzq5PM3uGc4QlMo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)