def check_key_value(data, key, value):
    """Checks a key for the given value within a dictionary recursively."""
    if isinstance(key, dict):
        for k, v in key.items():
            return check_key_value(data[k], v, value)

    if data[key] == value:
        return True

    return False