UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nomCr2m4oAQgZ7sy1ZjrW4Ad2cSRCtXuqllIlpkONvM='
WHERE
key_id = 'fb0480bf58f906fc79c6934827319cd9ad8320d3959cb0a9e62c33b2846e6dbc'
AND (
token = 'nomCr2m4oAQgZ7sy1ZjrW4Ad2cSRCtXuqllIlpkONvM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)