There is no "first instrument" date—only the oldest surviving instruments. Archaeology pushes the boundary further back each decade, but the actual origin is lost in the gap between "made of bone" and "made of perishable materials."
Perishable instruments almost certainly preceded bone:
• Wood/bamboo flutes (don't fossilize)
• Skin drums (frame drums, water drums)
• Rattles/shakers (gourds, seed pods, hoof rattles)
• Voice/body percussion (clapping, stomping, chest thumping — the true "first instruments")
This coincides with the Upper Paleolithic Revolution: symbolic art (cave paintings), personal adornment, burial rituals, complex tools. Music emerges as part of the cognitive package of behavioral modernity—not as a later luxury.
"At least 40,000 years ago" for physical instruments. "As long as humans have been human" for music itself. The first instrument was almost certainly a human body. The first made instrument is waiting in a cave, unexcavated—or rotted into soil 100,000 years ago.