Hamill gave the hosts the lead in the 65th minute from the penalty spot but then refused to give the ball back to the opposition and barged County boss Derek Adams over, leaving referee Willie Collum with little option but to show him a second yellow card.
Hamill, who will now be suspended for next weekend's Edinburgh derby against Hibernian, was fortunate that his dismissal did not come back to haunt Hearts, with Dale Carrick adding a second deep into stoppage-time.
Locke said: "There were that many bodies in front of me that I would have to have a look at it again. It seemed to be handbags but I will have to have a look at it again because, if it's a sending off, it's going to be costly.
"He'll miss the next game for sure. I'll have to see what Willie puts in his report. I've not spoken to Jamie, I think he's disappointed, the fact he's been sent off.
"I was on the pitch trying to calm everyone down. For me it was unnecessary, it was pretty stupid.
"We were just trying to calm our players down and make sure most of them behaved themselves, and thankfully most of them did that."
Adams refused to comment on the incident, but he was disappointed with his team's performance against their already-relegated opponents.
Adams said: "It's not been a good day for us. We have to get on with that now.
"We've got four games to go, we have to do better than we did in the second half, we didn't play with a tempo.
"They get the goal and had something to hang on to, we pushed forward and created openings but didn't take the chances, and then we get counter-attacked at the end."