Unless you have a really weird dryer, dryers intended for use in private homes are designed for 30A circuits. NEC 110.3 requires you follow instructions and labeling, and they call out 30A circuits, so you need a 30A circuit. (or at least a 30A breaker; you're always allowed to use larger wire than the circuit requires). The 30A breaker requires a 30A socket.
So a 50A socket generally has no place on a dryer circuit.
Grounding started coming in 1956, and by 1965 all circuits were required to be grounded. At that time, the appliance industry got a waiver for dryers and ranges allowing them to be "grounded" to the neutral, arguing that neutral wire failures were rare since the machine was rarely unplugged*, and the legal wires for such a connection are soon going obsolete anyway. This resulted in a steady stream of fatalities, including many children (often having squeezed behind the dryer to retrieve something, and thus unable to "leap back" after the initial shock). So the 3-wire arrangement was finally banned in 1996.
Note that use of "/2+ground" cable was never legal (the bare ground wrapped in paper is not sufficiently insulated to be used as neutral), but many cheap installers used it anyway after stocks of non-grounded cable depleted. If this was used, the cable must be replaced with /3+ground cable.
It may be possible to justify that this circuit was pre-1996 and therefore "grandfathered". However in any case, the breaker and outlet must be correct i.e. 30A.
I strongly recommend upgrading to the 4-prong outlet, NEMA 14-30, even if you must retrofit a ground wire, or power the circuit from a GFCI breaker and label the outlet "GFCI Protected/No Equipment Ground".
This type of surface-mount receptacle is readily available in NEMA 10-30, 10-50, 14-30 and 14-50. It may have a different aesthetic appearance; most I see have a rounded top rather than squared off, but the basic design of "rectangular brown box, knockouts on bottom and bottom-back" are no problem.
Note that entire black thing in the photo, all 2 x 3 x 6" of it, is the socket. It's a surface mount socket (which one might say comes with its own very unique junction box, if you prefer to think of it that way). The back half of it is a metal frame which is surface mounted to the wall. They come in a variety of shapes - round top, jukebox, or square, so choose your aesthetic. The Leviton's (e.g. 55054) may have the exact same "metal frame that attaches to the wall", and if so, that could spare you having to mess with the cable at all (other than adding the ground).
I find Home Depot and the other big-box stores to be dismally bad at having the selection you need at a sensible price. I would expect an electrical supply house to do much better. But OTOH... that link...