select ownerId, ownerType, defaultMode from tbl_SEC_ApiKeys with (nolock) where ApiKey = and ( validIpAddresses LIKE OR PublicAccess = 1 )