There are musicians from the 1950s who agreed to a flat-cash payment for each usage of their song (radio, single sales, jukeboxes). I helped set up their class-action suit against the record companies, as that payment didn't change even when the songs started showing up in big-budget movies & high-end commercials in the 1980s... but they still got that same flat-cash payment instead of a percentage of what the publishers & labels were getting.
Never sell outright -- well, unless it's like millions of dollars. Else, license it. The more exclusive it is, the higher your fee: if they want it for all foodstuff commercials for five years, that's far less than all rights for a decade. Clarify whether they get the right to resell -- if they do, the check probably ought to be bigger. Stuff like that.
I've done a little work in "commercial music." I wish I was more productive, because I used to know all the U.S. companies that would pay me hundreds of bucks for a little tune for use in radio ads & such, yet still allow me to put my name on it & add it to my demo tape.