extend_condition function

Extend a condition string by adding a new condition based on a variable and its value