UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VSO8ujh+/o0tXyLra1z9lU8IufZucN8k8I7lvPSvUC4='
WHERE
key_id = 'f41314a39b7963543313f54213cb6ff2bca4467bf65c94159f79e6a04cae6901'
AND (
token = 'VSO8ujh+/o0tXyLra1z9lU8IufZucN8k8I7lvPSvUC4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)