Recently I picked up a little Dell OptiPlex 3050 which has an M.2 SSD slot. I picked up a little 2230 M.2 SSD for a song only to find that the OptiPlex only had a 2242 mounting hole.
So I made this little clip.
It's designed to be bolted down with a fine pitch computer screw where the 2242 M.2 standoff would usually go and holds the SSD down by just the edge so as not to impede cooling on the main chip.
Hope this works as well for you as it does for me!