UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pQgQtlz6TfpohhR+VkO/yUSzPiKV8+qJuoDbFfzzSJk='
WHERE
key_id = 'a72a4d136f7a9f8ad03e32b68f80c7ee07b80a2862255b14d8351cdad1afe886'
AND (
token = 'pQgQtlz6TfpohhR+VkO/yUSzPiKV8+qJuoDbFfzzSJk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)