According to the table in 14 CFR 61.23 (d), the expiration date of your medical is based on your age "on the date of examination for your most recent medical certificate."
So, if you were 39 on the date of the examination, you're good for 60 months.
There is a possibility that the requirement to renew 3rd class medicals may go away completely soon. On Dec 15, 2015, the U.S. Senate passed the "Pilot's Bill of Rights 2". The bill would still need to be passed by the House and signed by the President before it would take effect. As of Dec 15, it had 152 co-sponsors of both parties in the House. According to AOPA:
Under the medical reforms of Pilot's Bill of Rights 2, most pilots who have held a valid third class medical, either regular or special issuance, within 10 years of the legislation’s enactment would never need to get another FAA medical exam. The rule would apply to pilots flying VFR or IFR in aircraft weighing up to 6,000 pounds and carrying up to five passengers at altitudes below 18,000 feet and speeds up to 250 knots.
Pilots who develop certain medical conditions, including a small list of specific cardiac, mental health, or neurological conditions, will have to get an FAA special issuance medical one time only, significantly reducing the time and money spent navigating the FAA’s medical bureaucracy.
For pilots who have not had a valid medical in the past 10 years and those who have never applied for and received a medical certificate, a one-time third class medical certification by an aviation medical examiner will be required. After a pilot has been medically certified once, either through the regular or special-issuance processes, he or she will also be able to fly indefinitely without needing to go through the FAA medical certification process again.
Example 1. A 47 year old airline pilot, gets her flight physical on June 15th, 2014. We euphemistically refer to the remainder of June 2014 (16th - 30th) as a fractional bonus time. According to the table, her first class certificate is good for operations requiring first class medical certification (Airline Transport Pilot) for 6 months after the fractional bonus time. This covers her for airline left seat duty (Class 1) through Dec 31, 2014. Her certificate then reverts to the equivalent of a 2nd class certificate for the first half of 2015. If she elects to downgrade her flying duties from airline to commercial pilot, there would be no need to repeat the exam for the first half of 2015 to exercise these lower 2nd class privileges. To summarize the first year following her flight physical, the original Medical Certificate is good for her to fly as an Airline Pilot in Command (1st class privileges) through Dec 31, 2014 and then as a Commercial Pilot or ATP Second in Command (2nd class privileges) for the next 6 months (Jan-Jun 2015) on that original Class 1 medical certificate from June 2014. If she had intended to continue working as Airline Pilot in Command (1st class), then she would have had to repeat the exam by Dec 31st 2014 and every 6 months forever until she stops exercising those higher privileges.
Assuming she upgrades to new equipment (bigger airliner) and now she is flying right seat stareting Jan 2015, since she does not need to function at that most restrictive level, the original medical certificate automatically reverted to a 2nd class certificate on Dec 31st, 2014 (fractional month of exam plus 6 months) and she is covered. She does not have to see the AME again if she just wants to fly ATP right seat (2 crew airliner) for the first half of 2015. This lower level 2nd class coverage exists for those 6 more months until a total of 12 calendar months (plus fractional month) have elapsed since the original exam. That 1st-->2nd reversion is true for any age. She is legal to fly as second-in-command in a 2 pilot airliner or as a commercial pilot (2nd class privileges) during Jan - Jun 2015 without another medical exam. If we fast forward to June 30, 2015 (1 year plus fractional month after exam), she now must get another AME exam to continue to fly commercially. Without another flight physical, her original certificate reverts down to 3rd class (Private Privileges) for an additional 12 months (Jul 2015 - June 2016). She only gets 2 years total because she was over age 40 at the time of the original flight physical.
Now move forward to the end of the 2 year exam anniversary: June 30, 2016. Because of her age over 40 at initial exam date, her privileges automatically scale down even further. Unless she gets another flight physical, she will no longer have class 3 privileges, and without seeing the AME again, she would only be eligible for operations that do not require medical certification, (gliders, balloons, etc) or those aviation operations that only require a current US Driver's License (light sport pilot activities). If she attempts another official FAA flight physical and fails, she would not even be eligible for light sport flight operations. Even though some pilot operations only require a driver's license, airman who pursue these activites must not have not failed an FAA flight physical. They must have either passed their most recent FAA Flight Physical (no time limit) or never taken one. Fortunately, this latter situation is uncommon. Many pilots who are healthy enough to retire from professional aviation and fly recreationally will successfully renew at the 3rd class level or revert to operations not requiring a flight physical without taking another exam.
Example 2. A 39 year old Private Pilot gets a Class 1 Medical Certificate on the same day June 15th, 2014. The FAA allows him to ambitiously apply and acquire an overshoot medical certification for an Airline Transport Medical Certificate (Class 1) even though he does not yet possess any higher aeronautical rating at the time of his flight physical. Like many pilots in the decisional phase of their career, he just wanted to see if he could pass the stricter medical exam--he thinks he might want to be an Airline Pilot one day and is testing the FAA medical system against his current state of health. He passes the 1st Class Exam. If he just stays at the level of a Private Pilot, then this 1st Class Airman Medical Certificate dated June 15th, 2014 is valid but his actual privileges are limited by his aeronautical rating, so it would medicolegally cover him for exercising those 3rd Class private privileges (carrying passengers, not for hire) until June 30, 2019--the remainder of that month plus 60 more since he was under age 40 at the time of the flight physical.
Alternatively, if this pilot gets motivated and earns his Commercial Pilot license during the first summer, say August 12, 2014, then his original medical exam from back in June 2014 would satisfy medical requirements for exercising the newly acquired aeronautical rating (class 2 privileges) even though he did not have that commercial pilot's license on the date of the medical exam. After his Commercial Pilot test and checkride, he now has the medical and aeronautical pieces to be legal without another visit to the AME. He can carry passengers for hire with his existing aviation medical certification through June 30, 2015 -- the fraction of the exam month plus another year.
Now assume a year has passed, and he has been flying as a new commercial pilot. We jump forward to June 2015. His original flight physical from June 2014 would now revert down to a 3rd class certificate valid for those limited privileges from July 2015 through June 30, 2019. For this younger pilot, he gets 60 total months after the month acquired because he was under age 40 at the time he got the exam. During the time July 2015 - June 2019 he is in reversion status. Although he could no longer exercise class 2 privileges without another visit to the AME, he could still continue to exercise class 3 (private) privileges even though he is now over 40.