Analog input timer

static unsigned long timerStart = 0;

if (analogRead(0) >= 2)
    timerStart = millis();

if (millis() - timerStart > 30000)
    digitalWrite (LEDpinStat, HIGH);   // A0 has been <2 for 30 seconds or more