It sounds like a reactive swelling of a superficially placed lymph node. Such swellings are commonly due to dandruff or scalp itchiness for any reason.
Next Steps
Please use a medicated anti dandruff shampoo, like Selshun, every alternate day for the next 10 days.
Health Tips
If the swelling increases in size, or other swellings appear, or this swelling recures, then further tests will be needed to understand it's nature.