All the info we have is here: Wiki: Validity of expired documents and permits (Portugal)
I donโt know exactly how D3 works, if itโs tied to your work then maybe you need to find another employer to be able to renew? Have you tried contacting an immigrant support group like CLAIM in your area?
Once you have lived there 5 years you should apply for PR + citizenship ASAP.