The only-slightly-more complicated method is to grab a d6 and assign different outcomes to its numbers. For just one example based on my own trap tastes:
At this point, you may also want to decide/dice for how the trap would normally be disabled by someone with the key – that is, unless the chest owner designed the trap to trigger regardless of whether the actual key was used or not! Some dungeon-dwellers andare mean like that.
Eventually you will have a custom-to-your-tastes-and-needs, finely-tuned trigger random table that you can use when stocking dungeons or when deciding hazards on-the-fly the fly.
There's another method for deciding this on the fly that eschews dice entirely, which is to go by the player's behaviour: the trap triggers when the player commits to the risky behaviour. "I unlock the chest!" without checking for traps? Trap springs as soon as they roll to unlock. You can describe the actual timing of the trigger any way you like, since the player has locked-in their course.