Add conditional where condition to hook_views_query_alter()

Hello everyone,
I was stucked making a few tweaks to a view trying to do the following.
In mysql exists the possibility to use WHERE IF to evaluate some variable/operation to apply differents conditions depending on the result/value, like a common IF/ELSE block, is there any way to do it with add_where() or any other similar method?
I need to apply a WHERE condition to the query when the value of a variable called $scope is G and a different when its L, there’s any way to achieve that?

Thank you in advance,

Drupal version: