You can say both.
In the first form, you consider what were the happening times possibilities before the event happened, and say that among all possibilities who did exist at that moment (before the event happened), the time when it happened was the best.
In the second one, you consider that it happened at the best time among all the possibilities who could exist ever (any time, any condition).
The difference is very light, and what I explain (it’s not very clear I’m afraid) is too strong, but I think it’s the nuance.
I think you can say that could not happen at a better time and that could not have happened at a better time, as translations of those expressions. I feel the same slight nuance in english but maybe I’m wrong…