Fixing query to include only not-expired and avoid pagination.