Problems controlling continuous rotation servo with IR sensor

I updated currentMillis

No. You "updated" lasttime. You need to call millis() again in the body of the while statement.

But, before you do that, all that the while loop is doing is waiting for some amount of time to pass, just like delay() does. You might as well use delay(), since you clearly don't understand that the point is to NOT just wait until some amount of time has passed.