INSPIRATION can strike at any time.

And from anywhere, apparently. St Mirren have come to rely on moments of stirring ingenuity if they are to get into the mix for a place in the top six of the Clydesdale Bank Premier League and last night that came in form of Graham Carey. The Paisley side are still seven points adrift of sixth place after this victory over Hearts but the midfielder proved that no distance should be allowed to inhibit ambition when he scored his side's second goal of the night with a wonderful 35-yard strike.

His side will need all the encouragement they can get if they are to coax the same promise of success from their league campaign that they have in the cup competitions. St Mirren face Celtic in a William Hill Scottish Cup quarter-final meeting on Saturday, while they will meet Hearts again next month in the Scottish Communities League Cup final.

The outcome of this match will be long forgotten by then but for last night, at least, St Mirren were able to boast they had drawn first blood, with the first drop spilled early. Darren Barr was already sporting a bandage around his head from a previous injury and the Hearts defender was certainly hard to miss as he grappled Lee Mair in the penalty area at a corner after just four minutes. Paul McGowan was similarly robust when he thumped the resultant spot-kick low into the net. "It gave St Mirren a lift," said John McGlynn, the Hearts manager. "It's the last thing we needed."

It allowed St Mirren to settle, something they would have appreciated since they had allowed for a few changes ahead of the meeting with Celtic at the weekend. Carey was one but the most notable change was up front where McGowan buzzed around at the feet of Sam Parkin and Lewis Guy. The latter castigated himself early in the first half when he lifted a header over the crossbar from a matter of yards out only for an offside flag to interrupt him, but it was Parkin who left the greater impact on how his side attacked.

The Englishman has been used sparingly since joining in the summer and his start brought a different dimension to St Mirren; the brawny striker a solid target for crosses if a little pedantic in his own distribution. He flashed one header wide from Paul Dummett's cross after 43 minutes.

Instead, it was Hearts that were made to seem disjointed. The gaps in their performance only left supporters to feel the chill a bit more in Paisley last night and their frustration was perhaps manifest in another clumsy challenge from Barr, this time on Carey after 28 minutes. The league campaign has become a bruising endurance exercise for Hearts – the Edinburgh side have won only once in the league since the turn of the year, against Dundee last month – and there was little evidence last night that it is about to change. That Craig Samson was just required to react to shots conjured from nothing by Jamie Walker and Michael Ngoo was telling.

Hearts yesterday tied up Scott Robinson and Billy King on new two-year contracts – while Brad McKay signed a one-year extension – as just reward for the mature performances they have shown this season; the pair acting as two parts of a young side that have at least shown themselves capable of mustering some persuasive passing moves, if few convincing results.

Their performances can be viewed as a promising work in progress ahead of next season but this defeat was a reminder that this Hearts side are still learning to walk. Rather than the sharp, intelligent passing moves they faltered and it was left to bold individuals to act alone; Walker darting forward to unleash a shot after 10 minutes which Samson parried, Ngoo fighting to wrestle the ball under control on the edge of the box before his shot was held. Since St Mirren enjoyed greater control of the match there was little invitation for one player to try and be a hero. Carey didn't need one. His goal came on the verge of half-time, but it held prominence throughout the rest of the game; the midfielder taking possession 35 yards from goal before delivering a devilish, arcing shot which dipped over Jamie MacDonald and into the net.

"It doesn't surprise me when you see that from him," said Danny Lennon, the St Mirren manager. "He's got some left foot, some talent. For the ridiculous distance you might ask 'what are you hitting it from there for?' That's why."