A Spanish man who set fire to a café after staff could not provide mayonnaise for his sandwich has been sentenced to three-and-a-half years in prison.