Man sentenced over attempted armed robbery in supermarket car park