Not necessarily.Keep driving it is the better option when compared to buying a brand new car.
Your old car has embedded energy in it, the longer it is being driven by you or by another the more that embedded energy is diluted & by extension it's relative impact is reduced.
There's eventually a tipping point when it's more environmentally friendly to buy a new car even allowing for the "sunk" CO2 and other environmental costs of the manufacturing of the new one. Here's one analysis, for example. There are plenty of others and, I'm sure, academic research on the matter.

New EV vs. old beater: Which is better for the environment?
EVs require more energy to build, but they are far more efficient to operate.
