UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NSLjOlX/Afj8Wc5yntoGHWJgvVfLWjdaH9R/BSNw3dk='
WHERE
key_id = '8e49d4aaaae93d55c00360f8d3124b4fde295574fccfcf027bd92c1ee26e017f'
AND (
token = 'NSLjOlX/Afj8Wc5yntoGHWJgvVfLWjdaH9R/BSNw3dk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)