A man has been sentenced for homophobically abusing a shop worker more than four years after the incident happened.