UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZA9DdYBKbXUMAjrKluHcNJj/ZAITf9rBdHpoqZHyY0E='
WHERE
key_id = '5c288f10c7cfb9b8ec20841928b38e004688c1708a44aa2cfae3f75d7a213eef'
AND (
token = 'ZA9DdYBKbXUMAjrKluHcNJj/ZAITf9rBdHpoqZHyY0E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)