UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qf0GPhNu3HJX7OSvrfdMm4oOLqgY/bpbbe7IliGBjsE='
WHERE
key_id = 'ed28c474dfefbaa1873964c32f17c8be0bcf446497ec4f512d3e2f57712a56f0'
AND (
token = 'qf0GPhNu3HJX7OSvrfdMm4oOLqgY/bpbbe7IliGBjsE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)