I think that 30 seconds would be quite a long time to stay compos mentis after a rapid decompression near 40,000'. I have heard 10-20 seconds is a pretty good average. You may stay awake for a little longer but you won't be able to do anything...
That's probably why the drills start with OXYGEN MASKS ON!