Is this on one PNR? Where is your destination? I have had good luck with DL to put me on a later flight with such connection times ... call and inquire, as a ST E+ they should at least try to help you. I would not risk a 40 minute connection from B to A w/o at least a back-up plan.