Slower subquery performance on older MySQL
For further performance, replace

KEY `userid` (`userid`),


With

KEY `ucf` (`userid`, `cis`, `cis_faktury`),


Your Answer has a problem:  It is "wrong" to GROUP BY only some of the non-aggregate columns in the SELECT.  (Newer versions spit at users for doing so.)  And, I can't see how the query would return the same results.

MySQL 5.6 and MariaDB 10.0 added a number of different optimizations.  It is hard to say what exactly lead to the timing difference you see.

Moving to InnoDB is also advised.