UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kFMrSMC/7hn/h4zi0bvP2KcmM5XQE8vseVOCFrz4L5Q='
WHERE
key_id = '46360f43d70ec2dab30e807285e5348378dcf6d27c287c5b5c3c62661d9b91c9'
AND (
token = 'kFMrSMC/7hn/h4zi0bvP2KcmM5XQE8vseVOCFrz4L5Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)