I had a similar issue in my toe a couple of years ago. It was due to a tiny splinter being lodged under the nail. It would be completely fine for periods of time, and then if I knocked it, it would erupt in pain for a couple of hours then slowly regress to just a throbbing pain. Mine was manageable, But The splinter eventually came out a couple of months later. You should see a Doctor, I vaguely recall that my doctor recommended to let the body handle it as the toe was not infected.