In a pilot with a Class 1 medical the oxygen level in the blood will equilibrate with the inspired oxygen partial pressure within 30 seconds breathing normally but within 15 seconds with the hyperventilation likely in such an emergency. So the issue is not 'delaying' hypoxia but the cerebral function with a particular oxygen supply to the brain.
At 40,000 feet the inspired partial pressure of oxygen if breathing 100% is 140 kPa. Breathing 21% oxygen - atmospheric air - at 10,000 feet it is 104 so maintaining altitude from a medical perspective seems OK.......BUT even with a tight fitting mask you wont get 100%. Added to that, the time to loss of consciousness (LOC) is much less than the time to LOC if you breath the same pp of oxygen at sea level - with an explosive decompression it may be a couple of seconds. Complications such as air emboli etc further complicate matters. Hypothermia may well cause breathholding if you are lucky, the heart stopping if not.
So yes if you fit the mask, train with it and slowly depressurise to 40,000 feet with no aircraft defects you will be fine, but in a real life depressurisation, even if of slow onset, I doubt you will be able to function although probably conscious