As the two flights are booked on separate tickets, and as Lufthansa and Kenya Airways are not interlining partners, you will need to collect your luggage in Nairobi. Because of that, you will need to leave the airport transit area in order to get to baggage claim, and so you will need to cross immigration.
As a Canadian national, you are required to obtain an e-visa prior to your arrival, applying at least one week, but no more than three months before arrival in Kenya. Be sure to choose the transit visa option, as that has a reduced fee of US $21 (while the standard tourist visa fee is US $51). This visa is valid for stays up to 72 hours. The application process is totally online, and you will receive your result within a few days. Be sure to carry both the printed confirmation of approval and proof of your ticket on Kenya Airways on your flight.