"Won't work" in this case is defined on a spectrum. Moderna's vaccine is currently about 90% efficacious. Newer variants could reduce that down to say 60% or more. At some point the current vaccine could become useless.
If the spike protein mutates, it means that the structure of the spike is different. Obviously the spike can't change too much, because it needs to still be able to latch onto cells, and many changes would be irrelevant. Even if one antibody suddenly stops working because of a slight shift in the protein, there are other antibodies targeting different parts of the protein that would still be effective.
Only if the spike changes so dramatically that literally none of the antibodies you had before are relevant anymore. That's why it's not super expected that we'll get a version of the virus that these vaccines won't at least produce some antibodies against.
Key quote: "B.1.1.7 is defined by 23 mutations from the original Wuhan strain, 8 of which are in the spike protein. The 3 mutations hypothesized to have the largest potential biological effect are N501Y, spike deletion 69-70del and P681H."
The B.1.351 (South Africa) variant has N501Y but not the 69-70 deletion. We're still learning, but virologists I follow are concerned that N501Y may be a driver of higher transmission. But it's likely that multiple mutations contribute.
[1]: https://asm.org/Articles/2021/January/B-1-1-7-What-We-Know-A...
Since these vaccines are targeting spike proteins, shouldn't they work with every variant? Is there (big) risk of a mutation actually changing the spike protein?