How to select "in between values" with Math nodes
Presumably, you want their age-- their lifetime is their total lifetime, determined at birth, not the current time since emission.
To map color to some particular range of ages, first map your age range to a 0,1 range, then use a color ramp:

All particles younger than 20 frames are green.  All particles older than 40 frames are red.  Between, we gradate (by linear RGB, as set by the color ramp.)