Having mentored a dozen of developers over the years, I've arrived at a strong bias toward hiring intrinsically motivated individuals. It's much easier to grow skills given someone is motivated than vice versa. KPIs (or "SMART" objectives) are mostly managerial toys that seldom improve work ethos.
Happiness in the workplace is more often than not related to other aspects than the primary process of developing software. If the subject matter itself (as in: "I earn a living while hating the building websites in PHP") is the root cause of unhappiness, no recovery plan, KPI or reward can fix this. Best find another job.