It sounds like your car is in "limp" mode...that is to say it will drive but not accelerate nor go above 30 mph.
This is to protect the engine from further damage....long enough for you to get to a garage.You could try buying a OBD reset plug that clears all the fault codes and see if it runs properly or returns to limp mode.If it does then you need to have the codes read by a garage to pinpoint the problem...before it causes even more problems.Usually sensors are to blame , lambda...electronic throttles...intermittent connections.
I had a ford maverick do this and eventually discovered the throttle was electronic and a few hard blips on the throttle linkage with the engine switched off freed the problem and the limp mode disappeared.