UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M2sg5LczL4WfIuPpRyZ3y2Df5z/MDlcmxhQNx24sfK4='
WHERE
key_id = '6d123ba744cac84bebe6c4ee3770126d41e82561a63727719af19cdbdf85f82c'
AND (
token = 'M2sg5LczL4WfIuPpRyZ3y2Df5z/MDlcmxhQNx24sfK4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)