i have the same problem, whenever i think about the time limit my hands just write fast on their own and i struggle to keep my handwriting legible. I've gotten a bit better with practice, i looked up some solutions on the internet which helped because i realised that my grip wasn't right. Try adjusting your grip, try different ways of holding your pen till it feels the most comfortable and when it's time for the exam try to concentrate on writing instead of just the time limit. for me, i found that focusing on each individual letter while i was writing made my handwriting look more decent than when i focus on the word as a whole.
Some videos on youtube helped , but i am sorry i can't remember which one helped the most.
Just practice "the quick brown fox jumps over the lazy dog" for 10 minutes each day, consistency is key.
Also try experimenting with different pens, thicker ones, or thinner ones , type of ink ...etc.