A past tense does not always have a past meaning. In some kinds of sentence we use verbs like I had, you went or I was wondering to talk about the present or future.
After if.
If I had the money now I'd buy a car.
If you caught the ten o'clock train tomorrow you could be in Edinburgh by supper-time.