First I have some comments / caveats.
Batteries have self-discharge, and discharge due to external load. Also, the capacity depends on the load. Larger loads will give you less Ah than smaller loads. But as the load gets smaller, at some point the capacity becomes nearly constant. And your load qualifies as very small, since the battery was able to support it for 40 days. Lithium and NiMH battery capacities are slightly less dependent on load than lead acid batteries, but all of them are in the "small load" category when discharged over 40 days.
However, in a 40 day period, depending on battery type, there may have been some significant self-discharge. I assume it is a lead acid battery, but what is the subtype? flooded, or gel cell, or absorbed glass mat (AGM)? The latter two have relatively lower self-discharge.
I told you that to tell you this: Very often, if self-discharge is negligible (not sure in this case), and the load is small, you can absolutely just estimate the life of the second cell based on the capacity of the first cell (assuming same type or subtype). In other words, if you get 40 days from 40 Ah, you will very likely get 60 days from 60 Ah, and 20 days from 20 Ah as long as the battery type is the same.
One last thing: self-discharge has a strong dependency on temperature. A battery which will hold 80 percent of its charge for a year at 25C, may discharge completely in 3 months at 60C. Those may not be the real numbers. I am kind of making that up for illustration purposes. But it is very dramatic, and applies to many battery types.