40 minutes can be done...
If you have the morning flight and are delayed arriving in Atlanta you can take the later flight to Montego Bay if space is available.... but 40 minutes is enough time to reach your connection. The Atlanta Airport layout is online so you can get an idea of where your gates are and how far you will have to go.
We fly Delta from Atlanta to MBJ and have had our departure delayed awaiting a delayed connector flight once. Usually everyone has made the flight and departure is not delayed----except that whole wait your turn to take off.
Your credit card may cover your luggage if it is delayed--check your benefits and they may cover your purchase of temporary items until your luggage arrives.
Enjoy yourself!