UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '81NT1vIk4KfCVb06YHNnq5LpsTiihm73DKOIdGV2Ce4='
WHERE
key_id = '954ae3ee6ede4986fbab90367b04ad5b97b5952cd9c06e5c73a10780519a13f1'
AND (
token = '81NT1vIk4KfCVb06YHNnq5LpsTiihm73DKOIdGV2Ce4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)