Or even without ADD, you might wish to look for a correlation between your attention span vs. how well you slept the night before.
Getting a good night of sleep seems to get more difficult as we get older. Lack of sleep impacts many aspects of mental performance, including attention span IME.
Depending on how bad this is, and how long it's been a problem, you might consider getting tested for ADD.
I waited way too long to do that, and I had decades of unnecessarily reduced productivity.