UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QrGa8QqnYadc3z2cUEo0DS6DTwEHWyUYC/qTZyRihnc='
WHERE
key_id = '208f3a57fb758124f86268eb9306afee833f4b7602ca8e9e7e795b86a191d871'
AND (
token = 'QrGa8QqnYadc3z2cUEo0DS6DTwEHWyUYC/qTZyRihnc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)