UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CMmJTD17r6ZtMXtW5+XxrcfcXTGTbc+tovD8oee7egk='
WHERE
key_id = 'eb0fe570462f46984bed80ae8551b82340153242fc13528503550820d6c574b0'
AND (
token = 'CMmJTD17r6ZtMXtW5+XxrcfcXTGTbc+tovD8oee7egk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)