UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pk/Cw8CF4y7rL55lx6msh8firWpO7Ipsh1jf1z1ZGwo='
WHERE
key_id = 'b8d100612ddc13cb39e1be267dce78bd9bafe53a96c4bfc31438299d84e68c1e'
AND (
token = 'Pk/Cw8CF4y7rL55lx6msh8firWpO7Ipsh1jf1z1ZGwo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)