UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pPPdd3D8vsxBIyGxIuKgM+uMlW4DAG/ckjJqZSKzb40=' 
WHERE 
  key_id = '84c689350d589275d66f422b85c7546265cda3b4c8fc6db1fc2bff1a135718a6' 
  AND (
    token = 'pPPdd3D8vsxBIyGxIuKgM+uMlW4DAG/ckjJqZSKzb40=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023