Control PWM motor running time with millis

There may be other problems but it looks like one is that every time you come through loop() if the conditions for switching the pump on are still true you switch it on again and reset pumpStartTime.

Try checking whether the pump is already on before you switch it on. Then you will only reset pumpStartTime when it actually needed starting not every time round the loop().

Steve