I tried the following, but it didn't work.
$kw = \app\models\Keyword::find()->where(['keyword'=>$word, ['or', ['country' => $country], ['country' => null]], ['or', ['language' => $language], ['language' => null]]]);
I also tried
$kw = \app\models\Keyword::find()->where(['keyword'=>$word, ['or', 'country' => $country, 'country' => null], ['or', 'language' => $language, 'language' => null]]);
Worthless error:
PHP Warning 'yii\base\ErrorException' with message 'strtoupper() expects parameter 1 to be string, array given'
Docs: http://www.yiiframework.com/doc-2.0/yii-db-queryinterface.html#where()-detail