UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pBs6MfEKmrHwCioGc0MTeYSlrqf2HS7AF+zMPP6VNO4=' 
WHERE 
  key_id = 'b446d49313e53247b386a4c3711921b06f477c1ec915a967e1e7c2a6fd5e2a4a' 
  AND (
    token = 'pBs6MfEKmrHwCioGc0MTeYSlrqf2HS7AF+zMPP6VNO4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032