UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8GLeu7GOjayIa32v5dVOnFkD0gBacVzlIU6ljXshTv8='
WHERE
key_id = '65d795fc82e8629bec96ab52d79934ecda17f7fdeb26b02d2d6e1b6997e5c9e0'
AND (
token = '8GLeu7GOjayIa32v5dVOnFkD0gBacVzlIU6ljXshTv8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)