Use correct DB for optout queries

Change-Id: Ia20ddb4db989df4d78c415d935baae01a522a305