Ok, got the answer for this one.
When the 10.5 ECP code was authorised, it was added to the keycodes files in C:\Program Files\ESRI\License10.3\sysgen.
As a 10.5 code isn't backwards compatible, subsequently my Portal went down.
I then was issued a 10.4.1 code which I was told was backwards compatible to 10.3.1.
This was also added to the keycodes file but the server could still not recognise this code and thought 10.5 code was the one I was trying to use.
The answer was deleting the 10.5 line out of the keycodes file and running the 10.4.1 ECP code again.
There are other posts about the syntax of the keycodes file on the net. Its very easy to understand what needs to be altered so the server reads the keycodes file correctly.
