switching shape memory valves with microcontroller using NPN transistors
(3.3V-0.6(=Vbe))/1k = 2.7mA
Output = 50mA   Ic/Ib= 18.5 which is expected as hFE reduces near 10% at saturation but is typ. rated at hFE=10.
Design for worst-case Ic/Ib=10  thus Ib = 25mA, Rb ~ 100~120 Ohms
update
5.5V logic is typically 50 OHms +25% here operating at 3.3V,  ESR or RdsOn may be on the higher tolerance side.  PIO = 25 mA Abs. max so if tolerances are slim, reduce to 22mA (3.3-0.65V)/22mA = use 120 only
The RdsOn is standard for all 5.5V max logic  but given as ESR=60 max on p35 of 49 but uncertain if that is for 5V so even if +50% or 75 Ohms is used, 25mA generates only 50mW.
for a given Vdd, RdsOn= Vol/Iol , (Vdd-Voh)/Ioh
2nd update

On 2nd thought you can use a 2nd bigger transistor (to reduce T) in a Darlington configuration and reduce the waste power of the 8.2 to allow 0.7V extra drop of the Darlington 240mA to 5.6 Ohms with two 10 to 12 Ohm R’s in parallel as it dumps over 300mWto 350mW.