UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8sUqj9XSQ9Yt6pm2+fPIyMHMQOvfDT8m9cdnEHJ+z5Y='
WHERE
key_id = '0140b26d62e41ed01f11553ba47045ae5920bef4999702cc7697dcd07a170246'
AND (
token = '8sUqj9XSQ9Yt6pm2+fPIyMHMQOvfDT8m9cdnEHJ+z5Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)