Concatenate function arguments with "AND" string if they're not None.
Concatenating strings with a common connector (such as ' AND ' here) is most idiomatically done using join. So the idea should be to:

return ' AND '.join(&lt;some list with the right `text:value` formatting&gt;)


The easiest way to get such list should be to pair the text part and the associated value using zip and then use a list comprehension to filter out undesired variables:

parameters = zip(
    ('host', 'app_name', 'instance', 'config_source', 'config_name'),
    (host, app_name, instance, config_source, config_name)
)
query = ['{}:{}'.format(text, value) for text, value in parameters if value is not None]
return ' AND '.join(query)


You can also simplify a bit by turning the list-comprehension into a generator expression and feeding it directly to join.

Lastly, the self parameter suggest that you are using this as a method of a class. But since you are not using self in the method, you should either make it a regular function or a saticmethod:

@staticmethod
def _get_query_string_for_get_config(host, app_name, instance, config_source, config_name):
    parameters = zip(
        ('host', 'app_name', 'instance', 'config_source', 'config_name'),
        (host, app_name, instance, config_source, config_name)
    )
    return ' AND '.join(
        '{}:{}'.format(text, value)
        for text, value in parameters
        if value is not None)