I find, even in my early 40's and divorced for many years when I out of seemingly no where find myself with noticing having a crush, I pause and ask myself what's going on for me in the present. I'm not talking some quick notice of attraction I'm talking cannot get them off the mind type of crush.
After jotting down in my journal what's going on for me it typically boils down to feeling vulnerable in certain ways. Frustrated with various areas of my life, etc.
Then I try to find ways to keep myself mentally occupied.
I'm sure that it's not the same as the day in and day out experience that you are going through. At the same time, I do know what it's like to carry on with an emotional affair. And I remember how and why that began.