20 KW will require about 81 AMPs and you only have a 50 Amp Main breaker.
A 100 AMP 220Volt service is marginal as you will not be able to run much else. It is the air conditioner load that will trip the 100 amp service with the roto phase running the CNC machine.
In an ideal situation a 200 amp service is the way to go for a small shop @ 220volts.
As for the conductor size and distance voltage drop will start to become a problem over 150 feet without increasing to the next bigger size conductor. Since you will not be starting the machine under load you should be able to get by on rated size conductors for the current being transmitted on the distances stated.