I am wondering if I have used "had recently" correctly?
Andrew was working as a technician when he was injured in a car accident earning $20 an hour. He had recently been given this job with an increase in salary from $18 an hour to $20 an hour.
Your use of "had recently" is perfect, but your first sentence has a problem with word order.
"Andrew was working as a technician earning $20 an hour when he was injured in a car accident" makes sense, but in your version the information about Andrew's rate of pay is misplaced.