I think I would do this "the other way around" - by resetting the timer every time the button is unpressed
void loop() {
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH) {
startTime = millis();
}
if (millis() - startTime >= interval) {
// do whatever
}
}
...R