If S and T are two multiplicatively closed sets, let Q be the set of pairwise products of elements in S cross elements in T. Verify that Q is a multiplicatively closed set, hence R/Q is a valid ring.
Now let's do something different. Let U be the image of T in R/S. Remember, this is not a homomorphic image, but rather, the fractions with numerators from T and denominators from S. If T were an ideal then U would be an ideal, but of course T is not an ideal - it doesn't even have 0.
Within the ring R/S, U is multiplicatively closed. Let's show this, even if S does not contain 1. Start with a and b in T and map them to aw/w and bw/w in R/S. Their product is abww/ww, which is equal to abw/w, which is the image of ab, which is in T. Thus U is a closed set in R/S, and we can talk about R/S/U.
We will show this is the same ring as R/Q. You know the drill. Create a map, show it is well defined, show it is 1-1, show it is onto, show it is a ring homomorphism.
Here is the map. If s1 comes from S, and t1 comes from T, define the function f as follows.
a1/(s1t1) → (a1/s1) / (t1w/w)
Is f well defined? Suppose a2/(s2t2) is another member of the same class, so that va1s2t2 = va2s1t1. Since v is in Q, write it as v1*v2. Moving to R/S/U, consider the following equation. We would like this to be true, so that the images belong to the same class. I've left out the w's, as though S contained 1; they don't really contribute to our understanding of things.
v2/1 * a1/s1 * t2/1 = v2/1 * a2/s2 * t1/1
Replace t2/1 with t2v1/v1, which does not change the class of t2/1 in R/S. Now perform arithmetic in the ring R/S.
a1/s1 * t2v/v1 = v2t1a2/s2
va1s2t2 = va2s1t1
The last equation is true, that's our given, so the images in R/S/U represent the same class, and f is well defined.
To show the map is surjective, consider the fraction (a1/s1) / (t1/s2). This is in the same equivalence class as (a1s2/s1) / (t1/1). This class comes from (a1s2)/(s1t1) in R/Q.
To show 1-1, suppose the image is in the class of 0.
v2a1/s1 = 0/1
The 0/1 on the right isn't 0, it's a class in R/S. If this equation holds, then there is a v1 in S satisfying the following.
v1v2a1 = 0
This means a1/s1 is equal to 0/1 in R/Q, and the kernel is zero after all.
Finally, the map preserves addition and multiplication. This is more algebra, like the above, and even more tedious. I think I'll leave it to you.
Therefore f is a ring isomorphism, and the two rings are the same.
As a corollary, R/S/T = R/T/S.
If S contains T contains 1, then R/(st) = R/S/T = R/S. We can make the last step because T is entirely units in R/S, so taking T inverse of R/S doesn't change anything.