Wish I had a helpful solution but I don't.
I will offer two suggestions that can help others. I don't offer them to scold or pile-on the two previous posters. I feel badly for them. I'd probably end up towing the bike to a dealer and have them yank out the ignition and re-key it, at significant expense.
Suggestion #1: Always have a second key somewhere. Never maintain a bike or car with one key.
Suggestion #2: Never ever, not once, set your keys in the trunk. Never. It's same as putting your hand on a red hot stove burner. Would you do that? Of course not, you would never do that. Not once. Putting the keys in the trunk requires the same mentality.
I've been tempted many times. It's convenient. "I'll just set them down for a sec and -- SLAM." The trunk falls closed and you're screwed. It took time to train myself. Many times I'd start to set the keys in the trunk and stop myself and pull them back and say, "Nope, that's not an option. We don't do that."
One other rule I follow unfailingly is not related to keys but may help spare someone from an accident. Cars turning in front of motorcycles is the #1 cause of motorcycle accidents and fatalities. It happens every week of every year.
Because of that, I never, ever, not once, take for granted that a car turning in front of me sees me and will let me pass. I never trust that turning car and just keep speeding down the road, daydreaming. Nope, my eyes are laser-focused on that turning car. I treat it like, "this is the one. This is a collision, and I have to avoid it." I do that every single time. Kind of a PITA, honestly, but I'd rather guarantee my safety than get caught by a sudden car turn that could be painful and possibly lethal.