UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7Fylqb8huqlgoF0ZnBWJa+UYJuMQzOTGQgK7c63hDXg=' 
WHERE 
  key_id = '9eda3a711780a131d329a02be48a8afefbc05f37ceffe6a507091ced2550e0ac' 
  AND (
    token = '7Fylqb8huqlgoF0ZnBWJa+UYJuMQzOTGQgK7c63hDXg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022