UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zf2jR+dS23TzaJaUOgsHZ52ZnygtZCiIqSklqSnEWoQ='
WHERE
key_id = '97ea37a1982b339a20c738283670b8d4b2ccf2379fcc261fbe25b660bb5759ef'
AND (
token = 'Zf2jR+dS23TzaJaUOgsHZ52ZnygtZCiIqSklqSnEWoQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)