using pullstime

pinMode(buttonPin, INPUT_PULLUP);
buttonState = digitalRead(buttonPin);
if (buttonState != lastButtonState) {
    // if the state has changed, increment the counter
    if (buttonState == HIGH) { // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<

That code's actually counting releases. With pullups enabled, pressed is low, yet you're looking for a high after a change, which is a release not a press.