UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q1iUq/jjDzQy6rBMu2rK2VnFZknlS5TmBCFT/NiQuug='
WHERE
key_id = '8500ee01d8cbb59b1f23aca0e2cb57ad0438479acbcd6a6f8b78d50706ef3289'
AND (
token = 'Q1iUq/jjDzQy6rBMu2rK2VnFZknlS5TmBCFT/NiQuug='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)